﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushJScript.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushXml.js"></script>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCore.css" />
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCoreEclipse.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
    <h3>带参数的Url表达式</h3>
    <p>
        <b>一般性的Url表达式{参数名}</b>
        <pre class="brush:csharp;">
            public class IndexController : BaseController
            {
                [GetHtml("/Index/Index-{page}.html")]
                public void Index(int page)
                {

                }
            }
        </pre>
        <b>带可选参数的Url表达式{参数名:解析方式}</b><br/>
        解析方式分为：string,int,float,date
        <pre class="brush:csharp;">
            public class IndexController : BaseController
            {
                [GetHtml("/Index/Index-{page:int}")]
                public void Index(int page,int id)
                {
                    
                }
            }
        </pre>
        <b>基于正则的Url表达式{参数名:正则表达式}</b>
        <pre class="brush:csharp;">
            public class IndexController : BaseController
            {
                [GetHtml("/Index/Index-{page:[0-9]+}")]
                public void Index()
                {
                    int page=this.parameters["page"];
                }
            }
        </pre>
    </p>
</body>
</html>